package com.qqt.csr.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qqt.csr.order.entity.WorkOrderEvent;
import java.util.List;

import com.qqt.csr.order.enums.WorkOrderStatusEnum;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface WorkOrderEventMapper extends BaseMapper<WorkOrderEvent> {
    int updateBatch(@Param("list") List<WorkOrderEvent> list);

    int updateBatchSelective(@Param("list") List<WorkOrderEvent> list);

    int batchInsert(@Param("list") List<WorkOrderEvent> list);

    /**
     * 获取工单最后事件
     * @param orderIds {@link List<Long>} 工单id列表
     * @param status {@link WorkOrderStatusEnum} 工单状态
     * @return {@link List<WorkOrderEvent>} 工单事件集
     */
    List<WorkOrderEvent> listLastEvent(@Param("list") List<Long> orderIds, @Param("status") WorkOrderStatusEnum status);
}